//****************************************************************
//* Copyright (c) 2008 Ford Motor Company. All Rights Reserved.
//*
//* $$Workfile:   MacropartInfoForm.java  $$
//* $$Revision:   1.0  $$
//* $$Author:   TMALDON4  $$
//* $$Date:   Mar 30 2009 13:46:54  $$
//*
//*****************************************************************
package ar.com.ford.it.fullEconomics.view.form;

import java.util.Collection;
import java.util.GregorianCalendar;
import org.apache.struts.validator.ValidatorForm;
import ar.com.ford.it.fullEconomics.persistence.dto.Ncas012VehicleVw;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesc02Coststvers;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesp06Mix;
import ar.com.ford.it.fullEconomics.persistence.dto.Teess01Supplier;
import ar.com.ford.it.fullEconomics.struct.MacropartInfoStruct;
import ar.com.ford.it.fullEconomics.util.FullEconomicsDateUtil;

public class MacropartInfoForm extends ValidatorForm {
    private Teesc02Coststvers costStrVersion;    
    private Ncas012VehicleVw vehicleLine;
    private Teesp06Mix mix;
    private Teess01Supplier supplier;
    private String mixDate;
    private String section;
    private Collection<MacropartInfoStruct> macropartStructCol;

    public void resetForm() {
        this.costStrVersion = null;
        this.supplier = null;        
        this.mix = null;
        this.vehicleLine = null;        
        this.mixDate = null;
        this.section = null;
        this.macropartStructCol = null;
    }

    public void setDetails() {
        GregorianCalendar cal = new GregorianCalendar();
        
        cal.setTimeInMillis(this.getMix().getEesp06MixEffectiveDateY().getTime());
        this.setSupplier(this.getCostStrVersion().getTeesc01Coststruct()
                .getTeess01Supplier());
        this.setMixDate(FullEconomicsDateUtil.format(cal));
    }

    public String getSection() {
        return section;
    }

    public void setSection(String section) {
        this.section = section;
    }

    public String getMixDate() {
        return mixDate;
    }

    public void setMixDate(String mixDate) {
        this.mixDate = mixDate;
    }

    public Teess01Supplier getSupplier() {
        return supplier;
    }

    public void setSupplier(Teess01Supplier supplier) {
        this.supplier = supplier;
    }

    public Ncas012VehicleVw getVehicleLine() {
        return vehicleLine;
    }

    public void setVehicleLine(Ncas012VehicleVw vehicleLine) {
        this.vehicleLine = vehicleLine;
    }

    public Teesc02Coststvers getCostStrVersion() {
        return costStrVersion;
    }

    public void setCostStrVersion(Teesc02Coststvers costStrVersion) {
        this.costStrVersion = costStrVersion;
    }

    public Teesp06Mix getMix() {
        return mix;
    }

    public void setMix(Teesp06Mix mix) {
        this.mix = mix;
    }

    public Collection<MacropartInfoStruct> getMacropartStructCol() {
        return macropartStructCol;
    }

    public void setMacropartStructCol(
                                      Collection<MacropartInfoStruct> macropartStructCol) {
        this.macropartStructCol = macropartStructCol;
    }

}
